package sis.testio.Sequence;/*
* @auther 顶风少年 
* @mail dfsn19970313@foxmail.com
* @date 2019-07-29 08:49
* @notify 
* @version 1.0
*/

import junit.framework.TestCase;

import java.io.*;

public class test1 extends TestCase {

    public void testSequence()throws Exception{
        InputStream in1 = new FileInputStream(new File("C:\\AgileJava\\src\\sis\\testio\\Sequence\\1.jpg"));
        InputStream in2 = new FileInputStream(new File("C:\\AgileJava\\src\\sis\\testio\\Sequence\\2.jpg"));
        OutputStream out = new FileOutputStream(new File("C:\\AgileJava\\src\\sis\\testio\\Sequence\\3.jpg"));
        SequenceInputStream sin = new SequenceInputStream(in1,in2);
        BufferedInputStream bufferedInputStream = new BufferedInputStream(sin);
        BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(out);


        int c = 0;
        while ((c=bufferedInputStream.read())!=-1){
            bufferedOutputStream.write(c);
        }

        out.close();
        sin.close();

    }

}
